package com.example.zhaojianxu.signin.common.util

import android.content.Context
import android.widget.Toast

class ToastUtil{

    private var toast: Toast? = null

    companion object {
        val instance: ToastUtil by lazy { ToastUtil() }
    }

    fun showToast(context: Context,message: String){
        if (toast == null){
            toast = Toast.makeText(context.applicationContext,message,Toast.LENGTH_LONG)
        }else{
            toast!!.setText(message)
        }

        toast!!.show()
    }
}